<?php /* Smarty version Smarty-3.1.6, created on 2018-05-23 10:49:52
         compiled from "D:/phpStudy/PHPTutorial/WWW/myshop/Admin/View\Order\listtable.html" */ ?>
<?php /*%%SmartyHeaderCode:17811772075b0264ff2a5cf8-80776303%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '027da3577df7a59473c38d640db6781dc5f04052' => 
    array (
      0 => 'D:/phpStudy/PHPTutorial/WWW/myshop/Admin/View\\Order\\listtable.html',
      1 => 1527043786,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '17811772075b0264ff2a5cf8-80776303',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.6',
  'unifunc' => 'content_5b0264ff3bdae',
  'variables' => 
  array (
    'orders' => 0,
    'v' => 0,
    'gv' => 0,
    'a' => 0,
    'total' => 0,
    'pagelist' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5b0264ff3bdae')) {function content_5b0264ff3bdae($_smarty_tpl) {?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="<?php echo @ADMIN_CSS_PATH;?>
style.css" rel="stylesheet" type="text/css" />
<!--<link href="<?php echo @CSS_PATH;?>
bootstrap.min.css" rel="stylesheet" type="text/css" />-->
<link href="css/select.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo @ADMIN_JS_PATH;?>
jquery.js"></script>
<script type="text/javascript" src="<?php echo @ADMIN_JS_PATH;?>
jquery.idTabs.min.js"></script>
<script type="text/javascript" src="<?php echo @ADMIN_JS_PATH;?>
select-ui.min.js"></script>
<script type="text/javascript" src="editor/kindeditor.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	$(".select3").uedSelect({
		width : 100
	});
});

</script>
<style type="text/css">
.scbtn{ background-image:none!important;}
.refunddialog{
	width: 485px;
    height: 260px;
    position: absolute;
    top: 10%;
    left: 30%;
    background: #fcfdfd;
    box-shadow: 1px 8px 10px 1px #9b9b9b;
    border-radius: 1px;
    behavior: url(js/pie.htc);
    display: none;
    z-index: 111111;
}
.acceptrefund, .refuserefund{
	    width: 96px;
    height: 35px;
    line-height: 35px;
    color: #fff;
    background: url(<?php echo @ADMIN_IMAGES_PATH;?>
/btnbg1.png) repeat-x;
    font-size: 14px;
    font-weight: bold;
    border-radius: 3px;
    cursor: pointer;
}
</style>
</head>

<body>

	
    
    <div class="formbody">
    
    
    <div id="usual1" class="usual"> 
    
  	<div id="tab2" class="tabson">
    
    
    <table class="imgtable">
    
    <thead>
    <tr>
    <th>订单编号</th>
    <th>用户</th>
    <th style="width: 300px;">商品</th>
    <th>金额</th>
    <th style="width: 400px;">地址</th>
    <th>状态</th>
    </tr>
    </thead>
    
    <tbody style="text-align: center;">
    <?php  $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['v']->_loop = false;
 $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['orders']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value){
$_smarty_tpl->tpl_vars['v']->_loop = true;
 $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['v']->key;
?>
    <tr>
    <td><?php echo $_smarty_tpl->tpl_vars['v']->value['uid'];?>
</td>
    <td><?php echo $_smarty_tpl->tpl_vars['v']->value['user_id'];?>
(<?php echo $_smarty_tpl->tpl_vars['v']->value['name'];?>
)</td>
    <td><?php  $_smarty_tpl->tpl_vars['gv'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['gv']->_loop = false;
 $_smarty_tpl->tpl_vars['gk'] = new Smarty_Variable;
 $_from = json_decode($_smarty_tpl->tpl_vars['v']->value['goods'],true); if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['gv']->key => $_smarty_tpl->tpl_vars['gv']->value){
$_smarty_tpl->tpl_vars['gv']->_loop = true;
 $_smarty_tpl->tpl_vars['gk']->value = $_smarty_tpl->tpl_vars['gv']->key;
?><?php echo $_smarty_tpl->tpl_vars['gv']->value['good']['name'];?>
X<?php echo $_smarty_tpl->tpl_vars['gv']->value['quantity'];?>
,<?php } ?></td>
    <td><?php echo $_smarty_tpl->tpl_vars['v']->value['paid_fee'];?>
</td>
    <?php $_smarty_tpl->tpl_vars['a'] = new Smarty_variable(json_decode($_smarty_tpl->tpl_vars['v']->value['address'],true), null, 0);?>
    <td><?php echo $_smarty_tpl->tpl_vars['a']->value['name'];?>
<?php echo $_smarty_tpl->tpl_vars['a']->value['phone'];?>
&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $_smarty_tpl->tpl_vars['a']->value['province'];?>
<?php echo $_smarty_tpl->tpl_vars['a']->value['city'];?>
<?php echo $_smarty_tpl->tpl_vars['a']->value['town'];?>
<?php echo $_smarty_tpl->tpl_vars['a']->value['detail'];?>
</td>
    <?php if ($_smarty_tpl->tpl_vars['v']->value['status']==1){?>
    <td><button style="height:35px;margin-bottom: 17px;margin-top: 17px;background-color: cornflowerblue;" value="<?php echo $_smarty_tpl->tpl_vars['v']->value['uid'];?>
" class="scbtn sendbt">发货</button></td>
    <?php }elseif($_smarty_tpl->tpl_vars['v']->value['status']==2){?>
    <td><button style="height:35px;margin-bottom: 17px;margin-top: 17px;background-color: orange;" value="<?php echo $_smarty_tpl->tpl_vars['v']->value['uid'];?>
" class="scbtn waitreceiver">待收货</button></td>
    <?php }elseif($_smarty_tpl->tpl_vars['v']->value['status']==3){?>
    <td><button style="height:35px;margin-bottom: 17px;margin-top: 17px;background-color: gold;" value="<?php echo $_smarty_tpl->tpl_vars['v']->value['uid'];?>
" class="scbtn">待评价</button></td>
    <?php }elseif($_smarty_tpl->tpl_vars['v']->value['status']==4){?>
    <td><button style="height:35px;margin-bottom: 17px;margin-top: 17px;background-color: orangered;" value="<?php echo $_smarty_tpl->tpl_vars['v']->value['uid'];?>
" class="scbtn waitrefund">申请退款</button></td>
    <?php }elseif($_smarty_tpl->tpl_vars['v']->value['status']==5){?>
    <td><button style="height:35px;margin-bottom: 17px;margin-top: 17px;background-color: orangered;" value="<?php echo $_smarty_tpl->tpl_vars['v']->value['uid'];?>
" class="scbtn waitrefund">已拒绝退款</button></td>
    <?php }elseif($_smarty_tpl->tpl_vars['v']->value['status']==6){?>
    <td><button style="height:35px;margin-bottom: 17px;margin-top: 17px;background-color: lightgreen;" value="<?php echo $_smarty_tpl->tpl_vars['v']->value['uid'];?>
" class="scbtn">已完成</button></td>
    <?php }elseif($_smarty_tpl->tpl_vars['v']->value['status']==7){?>
    <td><button style="height:35px;margin-bottom: 17px;margin-top: 17px;background-color: orangered;" value="<?php echo $_smarty_tpl->tpl_vars['v']->value['uid'];?>
" class="scbtn">已同意退款</button></td>
    <?php }?>
    </tr>
    <?php } ?>
    </tbody>
    </table>
    
    <div class="pagin">
    	<div class="message">共<i class="blue"><?php echo $_smarty_tpl->tpl_vars['total']->value;?>
</i>条记录，每页显示&nbsp;<i class="blue">10&nbsp;</i>条</div>
        <ul class="paginList">
        	<?php echo $_smarty_tpl->tpl_vars['pagelist']->value;?>

        </ul>
    </div>
    
    <!--<div>
    	<iframe name="kuaidi100" src="https://www.kuaidi100.com/frame/index.html" width="960" height="880" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>
	</div>-->
    <!--发货弹出框-->
    <div class="tip">
    	<div class="tiptop"><span>提示信息</span><a class="close"></a></div>
        <!--<form action="<?php echo @__CONTROLLER__;?>
/sendgoods" method="post">-->
      <div class="tipinfo">
        <div class="tipright">
        <input type="text" class="dfinput" name="uid" id="uid" value="" placeholder="uid" style="display: none;"/>
        <input type="text" class="dfinput" name="delcom" id="delcom" placeholder="物流公司" style="width: 270px;margin-bottom: 30px;position:relative; left: 10%;"/>
        <input type="text" class="dfinput" name="delnum" id="delnum" placeholder="快递单号" style="width: 270px;position:relative; left: 10%;"/>
        </div>
        </div>
        
        <div class="tipbtn" style="position:relative; left: 5%;">
        <input name="" type="submit"  class="sure" value="确定" />&nbsp;
        <input name="" type="button"  class="cancel" value="取消" />
        </div>
    	<!--</form>-->
    </div>
    <!--退款弹出框-->
    <div class="refunddialog" >
    	<div class="tiptop"><span>提示信息</span><a class="closerefund"></a></div>
        <!--<form action="<?php echo @__CONTROLLER__;?>
/sendgoods" method="post">-->
      <div class="tipinfo">
        <div class="tipright">
        <input type="text" class="dfinput" name="" id="refunduid" value="" placeholder="uid" style="display: none;"/>
        <label style="font-size: 21px;">退款原因:<b id="reason" style="font-size: 21px;color: red;">dd</b></label>
        </div>
        </div>
        
        <div class="tipbtn" style="position:relative; left: 5%;">
        <input name="" type="submit"  class="acceptrefund" value="同意退款" />&nbsp;
        <input name="" type="button"  class="refuserefund" value="拒绝退款" />
        </div>
    	<!--</form>-->
    </div>
    
    </div>  
       
	</div> 
    <script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');
	$(".sendbt").click(function(){
		$('#uid').val($(this).val());
		$('.tip').fadeIn();
		console.log($(this).val());
	})
	$(".close,.cancel").click(function(){
		$('.tip').fadeOut();
//		console.log($(this).val());
	})
	$(".closerefund").click(function(){
		$('.refunddialog').fadeOut();
//		console.log($(this).val());
	})
	$(".sure").click(function(){
		var data={
			uid:$("#uid").val(),
			delcom:$("#delcom").val(),
			delnum:$("#delnum").val(),
		}
		console.log(data);
		$.post("<?php echo @__CONTROLLER__;?>
/sendgoods", data, function(ret){
				console.log(ret);
				if(ret.errorcode){
					$(".tip").fadeOut();
					alert(ret.error);
				}else{
					$(".tip").fadeOut();
					window.location.reload();
				}
			})
		
	})
	$('.waitrefund').click(function(){
		//获取退款原因
		var wf=$(this);
		$('#refunduid').val(wf.val());
		var data={
			uid:wf.val(),
		}
		$.post("<?php echo @__CONTROLLER__;?>
/getrefundreason", data, function(ret){
				console.log(ret);
				if(ret){
					$("#reason").text(ret);
					$('.refunddialog').fadeIn();
				}else{
					alert("获取退款原因失败");
				}
			})
	})
	//同意或拒绝退款
	$(".acceptrefund,.refuserefund").click(function(){
		console.log($(this).val());
//		alert($('#refunduid').val());
		var data2={
			uid:$('#refunduid').val(),
			result:$(this).val()=="同意退款"?1:0,
		}
		console.log(data2);
		$.post("<?php echo @__CONTROLLER__;?>
/torefund", data2, function(ret){
				console.log(ret);
				$('.refunddialog').fadeOut();
				if(ret.errorcode){
					alert(ret.error);
				}
				
			})
	})
	</script>
    </div>

</body>
</html>
<?php }} ?>